#ifndef _STRATEGY_HH_
#define _STRATEGY_HH_
#include "Bfs.hh"
#include <cassert>
#include <set>

/// Look around and count from sLoc
void look_around(State & state, Location sLoc, unsigned team, double radius,
		 unsigned & enemies, unsigned & friends, unsigned & invisible);


/// Count reachable enemies according to the rules if one ant of team is at loc
unsigned count_reachable_enemies(State & state, Location sLoc, unsigned team);

/// Count reachable enemies according to the rules for a given ant position
unsigned count_reachable_enemies(State & state, Location sLoc);

/// Estimates power balance for a given position
double power_balance(State & state, Location sLoc, unsigned team, unsigned distance);

/// Help me attraction/repulsion potential
/// positive when position need help
/// negative if safe
double help_me(State & state, Location sLoc, unsigned team, unsigned distance, double alpha = 2.0);


/// estimate safety level of positions according to neighbourhood
// (uses BattleEngine)
void estimate_safety_levels(State & state);


/// Light and local Battle management
/// evaluates if a position is expected to die at t+1
/// static position
bool will_die(State & state, Location sLoc, unsigned & enemies_killed);


/// Light and local Battle management
/// evaluates if a position is expected to die at t+1
/// gives a probability
double may_die(State & state, Location sLoc, unsigned & killed_enemies);


/// Strategy parameters
const double explorationw = 1;
const double foodw = 1;
const double myhillw = 4;
const double friendw = 1;
const double hillw = 2;


/// set potentials for attraction/repulsion of ants
void set_potentials(State & state);

/// cache known information in case ants in range are lost
// TU: Yeah!! National Secret Agency
struct cache_state_info_t
{
    std::set<Location> enemyHills;
    std::set<Location> food;
};
void update_map_knowledge(State & state, cache_state_info_t & memory);

#endif /* _STRATEGY_HH_ */
